package com.sharp.wechat.dao.repository;

import com.sharp.kernel.mybatis.repository.BaseMysqlRepository;
import com.sharp.wechat.dao.entity.MmRoleTagMap;
import com.sharp.wechat.dao.mapper.MmRoleTagMapDao;
import org.springframework.stereotype.Service;
import tk.mybatis.mapper.entity.Example;

import javax.annotation.Resource;

/**
 * Title: MmRoleTagMapService
 * Description: Copyright: Copyright (c) 2019 Company: BHFAE
 *
 * @author Sharp
 * @date 2020/6/17 11:00
 */
@Service
public class MmRoleTagMapService extends BaseMysqlRepository<MmRoleTagMap, MmRoleTagMapDao> {

    @Resource
    private MmRoleTagMapDao mmRoleTagMapDao;

    @Override
    protected MmRoleTagMapDao getDao() {
        return mmRoleTagMapDao;
    }

    public MmRoleTagMap getOneRoleTagMapByRoleId(String roleId) {
        Example example = super.getExample();
        Example.Criteria criteria = example.createCriteria();
        criteria.andEqualTo("roleId", roleId);
        return super.selectOne(example);
    }
}


